package com.ym.medical.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;

/**
 * @Author wenbo
 * @Date 2020/8/25 10:55
 **/
@EnumDescription("用户收藏类型枚举")
public enum UserCollectionEnum implements DictEnum{
    //--------------------start-----------------


    /**
     * 未知
     */
    HOSPITAL("01","医院"),

    /**
     * 男
     */
    DOCTOR("02","男"),
    /**
     * 女
     */
    ARTICLE("03","文章"),

    //--------------------end-------------------
    ;

    private String key;

    private String value;

    UserCollectionEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(UserCollectionEnum.class,value);
        }
    }
}
